package com.happy3w.cmds.plan.config.staff;

import com.happy3w.cmds.utils.JsonUtils;
import jakarta.annotation.PostConstruct;
import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Component;

import java.io.File;
import java.util.List;

@Component
public class StaffManager {
    private StaffConfig config;

    public List<Staff> getStaffs() {
        return config.getStaffs();
    }

    @PostConstruct
    public void init() {
        this.config = JsonUtils.instance.loadFromFile(new File("config/staffs.json"), StaffConfig.class);
    }

    @Getter
    @Setter
    private static class StaffConfig {
        private List<Staff> staffs;
    }
}
